#!/bin/sh

DATE=$(date +%Y%m%d)
NAME=Neokylin-Server-5.0_U4-x86_64-Release-B14-pdp
NEW_ISO=${NAME}-$DATE.iso
ISO_DIR=NS_ZY_5.4
ISO_LABEL=Neokylin_Server_V5Update4

#mkisofs -f -o $NEW_ISO -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -allow-leading-dots -V "$ISO_LABEL" -T -l $ISO_DIR
mkisofs -r -T -J -V "$ISO_LABEL" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot  -x "lost+found" -o $NEW_ISO $ISO_DIR

isohybrid $NEW_ISO

implantisomd5 --force $NEW_ISO


md5sum $NEW_ISO > $NEW_ISO.md5

if [ $? = 0 ]; then
   echo ""
   echo "$NEW_ISO created!"
   echo ""
else
   echo "Oops,something wrong..."
fi
